export enum Platform {
  WEIBO = 'weibo',
  ZHIHU = 'zhihu',
  TOUTIAO = 'toutiao',
  BAIDU = 'baidu',
  XIAOHONGSHU = 'xiaohongshu',
  DOUYIN = 'douyin',
  TWITTER = 'twitter',
  REDDIT = 'reddit',
  YOUTUBE = 'youtube',
}

export interface HotItemBase {
  item_id: string;
  title: string;
  platform: Platform;
  rank: number;
  heat_value: string;
  heat_value_numeric?: number;  // 添加数值类型的热度值字段
  url: string;
  excerpt?: string;
  category?: string;
  crawled_at: Date;
  updated_at: Date;
}

export interface HotItemDetail extends HotItemBase {
  content?: string;
  author?: string;
  comments?: Comment[];
  media_urls?: string[];
  tags?: string[];
  view_count?: number;
  like_count?: number;
  comment_count?: number;
  share_count?: number;
}

export interface Comment {
  comment_id: string;
  author: string;
  content: string;
  created_at: Date;
  like_count: number;
  reply_count?: number;
  replies?: Comment[];
}

export interface HotItemTrend {
  item_id: string;
  timestamp: Date;
  heat_value: string;
  rank: number;
}

export interface FilterParams {
  platforms?: Platform[];
  timeRange?: TimeRange;
  category?: string;
  keyword?: string;
}

export enum TimeRange {
  LATEST = 'latest',
  TODAY = 'today',
  DAY = '24h',
  WEEK = '7d',
  CUSTOM = 'custom',
}

export interface PaginationParams {
  page: number;
  page_size: number;
}

export interface ApiResponse<T> {
  data: T;
  total: number;
  page: number;
  page_size: number;
  success: boolean;
  message?: string;
}